package com.example.owner.lettery1.ui


import com.example.owner.lettery1.bean.NetConfig
import com.example.owner.lettery1.modlus.NetApi
import com.example.owner.lettery1.modlus.NewsApi
import com.example.owner.lettery1.modlus.RetrofitClient

import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

class SwitchPresenter {

    fun getAppConfig(): Observable<NetConfig> {
        val api = RetrofitClient.createService(NewsApi::class.java)
        val observable = api.getSwitch(NetApi.APP_ID)
        return observable.subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .map { data ->
                    data
                }
    }
}